//
//  ST_Thread+Bt.swift
//  BTVideo
//
//  Created by DouLei on 2019/7/9.
//  Copyright © 2019 DouLei. All rights reserved.
//

import Foundation




func main_thread_execute(block: @escaping () -> Swift.Void) {
    
    if Thread.current.isMainThread {
        block()
    }else{
        DispatchQueue.main.async(execute: block)
    }
}

func back_thread_execute(block: @escaping () -> Swift.Void)  {
    
    DispatchQueue.global().async(execute: block)
}


func main_thread_execute(afterDelay:TimeInterval,block: @escaping () -> Swift.Void) {
    
    DispatchQueue.main.asyncAfter(deadline: .now() + afterDelay, execute: block)
    
}

func back_thread_execute(afterDelay:TimeInterval,block: @escaping () -> Swift.Void) {
    
    DispatchQueue.global().asyncAfter(deadline: .now() + afterDelay, execute: block)
    
}
